package com.example.orderserver.controller;

import com.example.orderserver.entities.OrderDetailet;
import com.example.orderserver.service.OrderDetailetService;
import com.example.server_engineer.controller.AbstractTypedController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Tag(name = "订单明细控制器")
@RequestMapping("order_detailet")
public class OrderDetailetController extends AbstractTypedController<OrderDetailet,Integer> {

    OrderDetailetController(OrderDetailetService orderDetailetService){
        this.svcContext = orderDetailetService;
    }

    @Resource
    OrderDetailetService osvc;

    // 根据orderid查订单明细
    @Operation(summary = "根据orderid查订单明细")
    @GetMapping("/query/byorder")
    public List<OrderDetailet> queryByOrderid(Integer orderId){
        return osvc.queryByOrderid(orderId);
    }


}
